package com.amumu.drama.common.modules.delivery.service;

import com.amumu.drama.common.constant.OperateTypeEnum;
import com.amumu.drama.common.modules.delivery.dto.DeliveryOrderStatusQueryResp;
import com.amumu.drama.common.modules.delivery.dto.req.DeliveryHandleDTO;
import com.amumu.drama.common.modules.order.dto.req.AdminDeliverySuccessReq;
import com.amumu.drama.model.OmsOrder;

import java.util.Map;

/**
 * @author sunzhuang
 * @date 2024/6/27 09:02
 * @slogan 天下风云出我辈, 一入代码岁月催
 * @desc 发货接口
 */
public interface DeliveryService {

    /***
     * （通用）处理发货
     */

    void delivery(Long orderId, DeliveryHandleDTO deliveryHandleDTO, OperateTypeEnum operateTypeEnum, Long operateId);


    /**
     * 发货回调
     */
    Object deliveryNotify(String deliveryType, Map<String, String> params, String body);

    /***
     * （接口直充）轮询查询订单状态
     */
    DeliveryOrderStatusQueryResp pollQueryDeliveryStatus(Long orderId, OmsOrder omsOrder, OperateTypeEnum operateTypeEnum, Long operateId,boolean deliveryStatusExist);



    /***
     * （人工）发货成功
     * @param request
     */
    void deliverySuccess(AdminDeliverySuccessReq request, OperateTypeEnum operateTypeEnum, Long operatorId);


    /***
     * （人工）发货失败
     */
    void deliveryFail(Long orderId, OperateTypeEnum operateTypeEnum, Long operatorId);


    /**
     * （暂时不用）退货
     *
     * @param orderId
     */
    void refund(Long orderId);

}
